//-----------------------------------------------------------------------
// <copyright file="SignOutCompletedEventArgs.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Microsoft.Live.Messenger
{
    using System;

    /// <summary>
    /// Represents the method that will handle the <see cref="User.SignOutCompleted"/> event of <see cref="User"/>.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">A <see cref="SignOutCompletedEventArgs"/> object that contains event data.</param>
    public delegate void SignOutCompletedEventHandler(object sender, SignOutCompletedEventArgs e);

    /// <summary>
    /// Provides data for the <see cref="User.SignOutCompleted"/> event.
    /// </summary>
    public class SignOutCompletedEventArgs : EventArgs
    {
        private readonly SignOutResultCode resultCode;
        private readonly object userState;

        /// <summary>
        /// Initializes a new instance of the <see cref="SignOutCompletedEventArgs"/> class.
        /// </summary>
        /// <param name="resultCode">The result code.</param>
        /// <param name="userState">The User state.</param>
        public SignOutCompletedEventArgs(
            SignOutResultCode resultCode,
            object userState)
        {
            this.resultCode = resultCode;
            this.userState = userState;
        }
        
        /// <summary>
        /// Gets the result code.
        /// </summary>
        public SignOutResultCode ResultCode
        {
            get { return this.resultCode; }
        }

        /// <summary>
        /// Gets the unique identifier for the asynchronous task.
        /// </summary>
        public object UserState
        {
            get { return this.userState; }
        }
    }
}